<template>
    <form action="/">
        <van-search
                v-model="value"
                placeholder="请输入搜索关键词"
                @search="onSearch"
        />
    </form>
</template>

<script>
    import {Toast} from 'vant'
    import {readName} from "../../../../network/m_home";
    export default {
        name: "Nav",
        data(){
            return{
                value:''
            }
        },
        methods:{
            async onSearch(val) {
                await readName(val).then((res) => {
                    this.$router.push('/mobile/home/music/name/'+val)
                    this.$bus.$emit('changeItem',res)
                })
            },
        },
    }
</script>

<style scoped>

</style>